const withSass = require('@zeit/next-sass');

const generateScopedName = (name, filename) => {
    const hash = hasha(filename + name, {algorithm: 'md5'});
    const basename = path.basename(filename, '.scss');
    return `${dashCase(basename)}-${name}-${hash.slice(0, 5)}`;
};

module.exports = withSass({
    /* config options here */
    cssModules: true,
    cssLoaderOptions: {
        importLoaders: 1,
        localIdentName: '[local]-[hash:base64:10]'
    }
})